<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例</title>
</head>
<body>

    <div id="app1"></div>

    <div id="app2">
        姓名: {{ reversedText }}
    </div>

    <script src="https://unpkg.com/vue/dist/vue.min.js"></script>
    <script>

        var app1 = new Vue({
            el: "#app1",
            data: {
                text: '123,456'
            }
        });

        var app2 = new Vue({
            el: "#app2",
            computed: {
                reversedText: function () {
                    // 这里依赖的是实例 app1 的数据 text, 当 text 发生变化时, 本实例的计算属性也会变化
                    return app1.text.split(',').reverse().join(',')
                }
            }
        });

    </script>

</body>
</html>